package thread;

public class DemoThreadDemo {
    public static void main(String[] args) {
        Thread rose=new Thread("rose"){
          public void run(){
              for (int i=0;i<5;i++){
                  System.out.println(getName()+":Let me go!");
                  try {
                      Thread.sleep(1000);
                  } catch (InterruptedException e) {
                      e.printStackTrace();
                  }
              }

              System.out.println(getName()+":谁TM推我？啊啊啊啊！");
              System.out.println("啪唧！");
          }
        };
        Thread jeck =new Thread("jeck"){
          public void run(){
              while (true){
                  System.out.println(getName()+":you jump i jump!");
                  try {
                      Thread.sleep(1000);
                  } catch (InterruptedException e) {
                      e.printStackTrace();
                  }
              }

          }

        };
        rose.start();
        jeck.setDaemon(true);
        jeck.start();
        //while (true);主循环不死，守护线程不死，主线程也是用户线程
    }
}
